package com.itheima.edu.info.manager.service;

import com.itheima.edu.info.manager.dao.ManagerDao;
import com.itheima.edu.info.manager.domain.Manager;

import java.util.ArrayList;

public class LoginService {
   public boolean login(String id, String password){
       boolean loginFlag=false;
       ManagerDao managerDao=new ManagerDao();
       ArrayList<Manager> allManager = managerDao.findAllManager();
       for (int i = 0; i < allManager.size(); i++) {
           Manager manager = allManager.get(i);
           if ((id.equals(manager.getId()))&&(password.equals(manager.getPassword()))){
               loginFlag=true;
           }

       }
       return loginFlag;
   }
}
